package com.hzh.jetpackcomposecompositionlocal

import androidx.compose.material3.Text
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith

/**
 * @author huangzehui
 * @date 17/8/2025 下午9:19 周日
 * @description 显式传参
 */
@RunWith(AndroidJUnit4::class)
class ExplicitTest {

    private fun Layout(){
        val color = "黑色"
        // 参数需要通过层层传递，比较繁琐
        Text(color)
        Grid(color)
        Text(color)
        Text(color)
    }

    private fun Grid(color: String) {
        println("other components in Grid")
        Text(color = color)
    }

    private fun Text(color: String) {
        println("Text")
        println(color)
    }

    @Test
    fun test_explicit() {
        Layout()
    }

}